package br.com.hbt.generics;

import java.util.ArrayList;
import java.util.List;

public class Generico<E extends Object> {

    private E elemento;

    public static void main(String[] args) {

        Generico<String> gen = new Generico<String>();
        gen.getElemento();

        List<Generico<Object>> obj;
        List<? extends Object> obj2;
        List<? super Object> obj3;
        //        List<E> obj4;
        //        obj.add(new Generico<Object>());
        //        obj.get(0);
        for (int i = 0; i < 10; i++) {
            List<Integer> listInt = new ArrayList<>();
        }
    }

    public static double some(List<? extends Number> numList) {

        double total = 0;
        for (Number number : numList) {
            total += number.doubleValue();
        }

        return total;

    }

    public E getElemento() {
        return elemento;
    }

    public void setElemento(E elemento) {
        this.elemento = elemento;
    }

}
